$.ajaxPrefilter(function(options) {
        if (options.url.indexOf('/static/data/') !== -1) {
            console.log('访问本地数据');
        }  else {
            options.url = 'http://127.0.0.1:5000' + options.url
        }
        console.log(options.url);
    })
    //封装一个Ajax 用promise
function jqAjax(methods, url, data) {
    console.log("进入了jqAjax")
    return new Promise((resolve, reject) => {
        console.log('进promise');
        console.log(data);
        $.ajax({
            type: methods,
            url: url,
            contentType: 'application/json',
            data: data,
            async: 'true',
            success: function(res) {
                console.log(res);
                resolve(res);
            },
            error: function(xhr, status, error) {
                console.log(error);
                console.log(status);
                reject(error);
            }
        })

    })
}